//
//  TiXianRecordVC.m
//  NtoccShipper
//
//  Created by zcj on 2021/1/29.
//  Copyright © 2021 zhuchongjin. All rights reserved.
//

#import "TiXianRecordVC.h"
#import "TiXianRecordListVC.h"

@interface TiXianRecordVC ()

@end

@implementation TiXianRecordVC
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = NO;
    self.navigationController.navigationBar.tintColor = [UIColor cjMainTextColor];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}
- (void)viewDidLoad {
    // Do any additional setup after loading the view.
    
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 150, 44)];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.font = [UIFont cjTitleFont18];
    titleLabel.textColor = [UIColor cjMainTextColor];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"提现记录";
    self.navigationItem.titleView = titleLabel;
    
    UIImage *img = [[UIImage imageNamed:@"zcj_arrow_back"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
     UIBarButtonItem * leftItem = [[UIBarButtonItem alloc] initWithImage:img style:UIBarButtonItemStyleDone target:self action:@selector(leftBarBtnClicked)];
     self.navigationItem.leftBarButtonItem = leftItem;
    
    self.titleArray = @[@"全部", @"待审核", @"已审核", @"驳回", @"处理中", @"成功" , @"失败"];
    self.titles = @[@"", @"WAIT_AUDIT", @"AUDITED", @"REJECT", @"DEALING", @"SUCCESS", @"FAIL"];
    
//    self.navigationController.navigationBar.barTintColor = [UIColor cjMainColor];

     self.menuViewStyle = WMMenuViewStyleLine;
     self.titleSizeSelected = 16;
     self.titleSizeNormal = 14;
     //
     self.progressViewIsNaughty = YES;
//     self.progressWidth = 30;
     self.progressHeight = 2;
     self.progressWidth = 30;
     self.titleColorNormal = [UIColor cjMainTextColor];
     self.titleColorSelected = [UIColor cjMainColor];
     //   self.preloadPolicy = WMPageControllerPreloadPolicyNever;
     //         self.menuBGColor = [UIColor whiteColor];
     self.showOnNavigationBar = NO;
     [super viewDidLoad];

}

- (void)leftBarBtnClicked{
     [self.navigationController popViewControllerAnimated:YES];
  
}

//1、返回分页数量，可以再这里设置标题栏各种样式
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    
    return 7;
}

//3、把标题与分页对应起来
- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return _titleArray[index];
    
}

- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    
    TiXianRecordListVC* vc  = [[TiXianRecordListVC alloc]init];
    vc.indexPage = self.titles[index];
//    vc.search_condition = self.titles[index];
//    vc.strCode = self.strCode;
    return vc;
    
}

- (CGFloat)menuView:(WMMenuView *)menu widthForItemAtIndex:(NSInteger)index {
    CGFloat width = [super menuView:menu widthForItemAtIndex:index];
    return width ;
}




- (CGRect)pageController:(WMPageController *)pageController preferredFrameForMenuView:(WMMenuView *)menuView {
    
    menuView.backgroundColor = [UIColor clearColor];
    //    CGFloat leftMargin = self.showOnNavigationBar ? 0 : 0;
//    CGFloat originY = self.showOnNavigationBar ? 0 : CGRectGetMaxY(self.navigationController.navigationBar.frame);
    return CGRectMake(0, kTopHeight, self.view.frame.size.width, 44);
}

- (CGRect)pageController:(WMPageController *)pageController preferredFrameForContentView:(WMScrollView *)contentView {
    
    CGFloat originY = CGRectGetMaxY([self pageController:pageController preferredFrameForMenuView:self.menuView]);
    return CGRectMake(0, originY, self.view.frame.size.width, self.view.frame.size.height - originY);
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
